#header {
  width: 100%;
  box-shadow: 0 0 0.3rem 0 var(--shadow-color);
  margin: 0 auto;
  height: 3rem;
  padding: 0.5rem 1rem;
  animation: 0.3s ease-in-out forwards;
  animation-name: header-slideDown;
  z-index: 2;

  > div:nth-child(1) {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .user {
      display: flex;
      height: 100%;

      > p {
        margin-left: 0.5rem;
      }

    }

    > div:nth-child(2) {
      svg {
        cursor: pointer;

        &:nth-child(2) {
          margin-left: 1rem;
        }
      }
    }
  }

  .MoreIcon-box {
    height: 100%;
    position: relative;
    justify-content: flex-end;
    .z-badge {
      position: absolute;
      width: 0.7rem;
      height: 0.7rem;
      top: -0.1rem;
      right: -0.1rem;
      border-radius: 50%;
      font-size: 0.5rem;
      line-height: 0.7rem;
      text-align: center;
      font-weight: bold;
      color: var(--text-color-white);
      background-color: var(--red-40);
    }

    .MoreIcon-box-ul {
      position: absolute;
      width: 8rem;
      top: 100%;
      right: 0;
      box-shadow: rgba(0, 0, 0, 0.08) 0 4px 12px;
      background-color: var(--background-color-white);
      border-radius: 0.3rem;
      visibility: hidden;
      opacity: 0; /* 初始透明度为0 */
      transform: scale(0); /* 初始缩放为0 */
      transform-origin: top right;
      transition: opacity 0.3s ease, transform 0.3s ease; /* 定义动画效果 */

      > li {
        position: relative;
        justify-content: start;
        padding: 0.5rem 1rem;
        cursor: pointer;



        > svg {
          color: var(--text-color-gray);
          margin-right: 0.5rem;
          width: 1.2rem;
          height: 1.2rem;
        }


        &:active, &:hover {
          background-color: var(--background-color--gray);

          > svg {
            color: var(--text-color);
          }
        }
      }
    }

    &:hover {
      width: 8rem;
      .MoreIcon-box-ul {
        opacity: 1; /* 淡入 */
        visibility: visible;
        transform: scale(1); /* 缩放到正常大小 */
      }
    }
  }


}

// 定义从下到上的动画
@keyframes header-slideUp {
  from {
    opacity: 0;
    transform: translateY(-3rem); // 从底部50px的位置开始
  }
  to {
    opacity: 1;
    transform: translateY(0); // 移动到顶部
  }
}

// 定义从上到下的动画
@keyframes header-slideDown {
  from {
    position: fixed;
    opacity: 1;
    transform: translateY(0); // 从顶部开始
  }
  to {
    position: fixed;
    opacity: 0;
    transform: translateY(-3rem); // 移动到底部50px的位置
    display: none;
  }
}